
# OOP 三大特征
# 1. 封装 encapsulation

class Student:
    age = 18           #类属性 attribute
    def __init__(self,n=None,s=0):
        self.__name = n  #对象属性
        self.__score = int(s)

    def getName(self):
       return self.__name

    def print_score(self):
        print(self.__score)

    def set_score(self,score):
        if type(score) == int:
            self.__score = score
        else:
            print("input again")
    # def  print_age(self):
    #     print(self.age)

    # @classmethod
    # def  print_age(cls):
    #     print(cls.age)

if __name__ == '__main__':
    marvin = Student("marvin",90) #Object instance
    marvin.__name = "zwb"
    print(marvin.__name)
    marvin.print_name()

    # marvin.score = "zwb"
    # marvin.set_score("awb")
    # marvin.print_score() #85


